package com.fast.commons.web.model;


/**
 * 参照EasyUI DataGrid 分页参数
 * sort id
 * order desc
 * orderby id desc
 * page 4
 * pageIndex 3
 * pageNumber 4
 * pageSize 30
 * rows 30 
 * @author Administrator
 *
 */
public class SystemContext {
	
	private static ThreadLocal<String> order = new ThreadLocal<String>() ;
	
	private static ThreadLocal<String> sort = new ThreadLocal<String>() ;
	
	private static ThreadLocal<String> orderby = new ThreadLocal<String>() ;
	
	private static ThreadLocal<Integer> pageNum = new ThreadLocal<Integer>() ;
	
	private static ThreadLocal<Integer> pageSize = new ThreadLocal<Integer>() ;
	
	public static String getOrder() {
		return order.get();
	}
	public static void setOrder(String _order) {
		order.set(_order);
	}
	public static void removeOrder() {
		order.remove() ; 
	}
	
	
	public static String getSort() {
		return sort.get();
	}
	public static void setSort(String _sort) {
		sort.set(_sort);
	}
	public static void removeSort() {
		sort.remove() ; 
	}
	
	
	public static String getOrderby() {
		return orderby.get();
	}
	public static void setOrderby(String _orderby) {
		orderby.set(_orderby);
	}
	public static void removeOrderby() {
		orderby.remove() ; 
	}
	
	public static Integer getPageNum() {
		if(null == pageNum.get()) {
			pageNum.set(1) ;
		}
		return pageNum.get();
	}
	public static void setPageNum(Integer _pageNum) {
		pageNum.set(_pageNum);
	}
	public static void removePageNum() {
		pageNum.remove() ; 
	}
	
	
	public static Integer getPageSize() {
		if(null == pageSize.get()) {
			pageSize.set(30) ;
		}
		return pageSize.get();
	}
	public static void setPageSize(Integer _pageSize) {
		pageSize.set(_pageSize);
	}
	public static void removePageSize() {
		pageSize.remove() ; 
	}
	
}
